package club.justwill.single.model;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by xiangnan on 15-12-24.
 */
public class CoreConstants {
    public static final String TIMESTAMP_PATTERN = "yyyy-MM-dd'T'kk:mm:ss.SSSSSS'Z'";

    public static final String DATE_PATTERN = "yyyy-MM-dd";

    public static final String MIME_THRIFT = "application/x-thrift";

    public static final String MIME_JSON = "application/json";

    public static final String MIME_HTML = "text/html";

    public static final String MIME_JPEG = "image/jpeg";

    public static final String MIME_PNG = "image/png";

    public static final String MIME_HTML_UTF8 = "text/html; charset=UTF-8";

    public static final String MIME_TEXT_UTF8 = "text/plain; charset=UTF-8";

    public static final String MIME_FORM_DATA = "multipart/form-data";

    public static final String PATH_SEPARATOR = "/";

    public static final String DEFAULT_FILE_NAME = "orginal";

    public static final int DEFAULT_PAGE_INDEX = 0;

    public static final int DEFAULT_PAGE_COUNT = 20;

    public static final long ID_SYSTEM = 1L;

    public static final long ID_ANONYMOUS = 2L;

    public static final String SEND_AUTHCODE_SUCCESSFUL = "2";

    public static final long BASE_MODEL_ID = 19023L;
    public static final int UNKNOWN = 0;//性别未知
    public static final int MALE = 1;//性别男
    public static final int FEMALE = 2;//性别女
    public static final String DEFAULT_HEAD_ICON = "/picture/icon/u=1973656475,2574135779&fm=21&gp=0.jpg";
    public static final String DEFAULT_PASSWORD = "12345678";

    //status
    public static final int NONACTIVATED = 0;
    public static final int ACTIVE = 10;
    public static final int ABNORMAL = 20;
    public static final int FROZEN = 30;

    //project status
    public static final int PRE_AUDIT = 0;
    public static final int AUDIT_SUC = 10;
    public static final int AUDIT_FAIL = 100;
    public static final int PRE_SALE = 20;
    public static final int SALING = 30;
    public static final int PROFITING = 40;
    public static final int FINISH = 50;

    //audit status
    public static final int AUDITS_FAIL = 100;
    public static final int AUDITING = 20;
    public static final int AUDITS_SUC = 10;

    //order status
    public static final int ORDER_PAID = 10;
    public static final int ORDER_NOT_PAID = 20;
    public static final int ORDER_REVOKE = 30;
    public static final int ORDER_RECEIVED = 40;
    public static final int ORDER_NOT_RECEIVED = 50;

    //user activity status
    public static final int USER_ACTIVITY_GET = 10;
    public static final int USER_ACTIVITY_NO_GET = 0;

    public static final int NOT_IS_ADMIN = 1000000;



    //channel
    public static final int API = 0;
    public static final int ADMIN = 10;
    public static final int PC = 20;

    //timestamp
    public static final Integer TIMESTAMP_NOT_IS_NULL = 200000;

    public static final Integer TIMESTAMP_FORMAT_ERROR = 200001;
    //error message
    public static final Integer SYSTEM_ERROR = 100000;
    public static final Integer AUTHORITY_ERROR = 100001;
    public static final Integer AUDIT_STATUS_ERROR = 10000001;
    public static final Integer MOBILE_ERROR = 100100;
    public static final Integer NET_WORD_ERROR = 100101;
    public static final Integer AUTH_CODE_ERROR = 100102;
    public static final Integer USER_NOT_EXIST = 100103;
    public static final Integer PASSWORD_ERROR = 100104;
    public static final Integer INVALID_INVITATION_CODE = 100105;
    public static final Integer PASSWORD_DONT_SAME = 100106;
    public static final Integer PHONE_NUMBER_NOT_REGISTRIED = 100107;
    public static final Integer PHONE_NUMBER_CHANGED = 100108;
    public static final Integer PASSWORD_NOT_QUALIFIED = 100109;
    public static final Integer USER_ALREADY_EXISTS = 100110;
    public static final Integer USER_EXIST = 100110;
    public static final Integer USER_NOT_FOLLOW_PROJECT = 100111;
    public static final Integer Aliase_Type_Error = 100112;
    public static final Integer DATE_ERROR = 100113;
    public static final Integer LOG_OUT_ERROR = 100114;
    public static final Integer USER_NOT_BUSINESS = 100115;
    public static final Integer WEIXIN_ALREADY_LINKED = 100116;
    public static final Integer GET_WEIXIN_TOKEN_ERROR = 100117;

    public static final Integer PROJECT_TYPE_ERROR = 200100;
    public static final Integer START_MONEY_ERROR = 200101;
    public static final Integer PROJECT_ENDTIME_ERROR = 200102;
    public static final Integer PROJECT_PEOPLE_NUM_ERROR = 200103;
    public static final Integer PROJECT_CREATE_ERROR = 200104;
    public static final Integer PROJECT_ALREADY_FOLLOWED = 200105;
    public static final Integer NO_FOLLOWED_PROJECTED = 200106;

    public static final Integer ORDER_NOT_IS_NULL = 100204;
    public static final Integer ORDER_INVIAL = 100205;
    public static final Integer ORDER_PAID_ALREADY = 100206;
    public static final Integer ORDER_RECEIVED_ALREADY = 100207;
    public static final Integer ORDER_CANT_CONFIRM_RECEIVE = 100208;
    public static final Integer ORDER_PAID_FAILED = 100209;
    public static final Integer PROJECT_INTRODUCE_TYPE_ERROR = 300100;
    public static final Integer PROJECT_INTRODUCE_IS_EMPTY = 300101;
    public static final Integer PROJECT_INTRODUCE_CREATE_ERROR = 300102;
    public static final Integer PROJECT_INTRODUCE_TEXT_ERROR = 300103;
    public static final Integer PROJECT_INTRODUCE_CTYPE_ERROR = 300104;
    public static final Integer PROJECT_INTRODUCE_ARGUMENT_ERROR = 300105;

    public static final Integer UNIT_PRICE_ERROR = 200105;
    public static final Integer SKU_NUMBER_ERROR = 200106;
    public static final Integer SKU_INVAIL = 200107;
    public static final Integer SKU_IS_EMPTY = 200108;
    public static final Integer PROJECT_NOT_EXIST = 200109;
    public static final Integer PROJECT_AGREEMENT_EXIST = 200110;

    public static final Integer INDEX_ERROR = 201000;
    public static final Integer SIZE_ERROR = 201001;
    public static final Integer TAG_ERROR = 2001002;
    public static final Integer STATUS_ERROR = 2001003;
    //project
    public static final Integer AGGREMENT_NOT_IS_NULL = 300201;
    public static final Integer SERVICE_BONUS_IS_ERROR = 300203;
    public static final Integer PROJECT_NEDD_RECEIVE_GOOD = 300204;
    public static final Integer TRADE_NUMBER_EXIT = 300204;
    public static final Integer PROJECT_REFUND_FAIL = 3002040;

    public static final Integer STICK_ID_ERROR = 300301;

    public static final Integer SUPPORT_INFO_IS_NULL = 300302;
    public static final Integer UP_MP_DP_OR_ERROR = 300305;

    //activity
    public static final Integer ACTIVITY_NOT_EXIST = 400101;
    public static final Integer USER_ACTIVITY_EXIST = 400102;

    //USER
    public static final Integer USER_INVIAL = 100300;
    public static final Integer USER_ACTIVITY_GET_ALREADY = 100301;
    public static final Integer USERID_CAST_ERROR = 100302;
    public static final Integer PLEASE_LOGIN = 100303;
    public static final Integer SECURITY_CODE_NOT_SAME = 100304;
    public static final Integer SECURITY_LENGTH_ERROR = 100305;
    //invitation
    public static final Integer INVITEE_NOT_ENOUGH = 100400;
    public static final Integer INTIVATION_IS_EMPTY = 100401;
    public static final Integer ENDTIME_ERROR = 100600;

    //address
    public static final Integer ADDRESS_IS_NULL = 100501;
    //file
    public static final Integer FILE_UPLOAD_FAILED = 100500;

    public static final Integer SMALL_NUMBER_ERROR = 300000;
    public static final Integer SETT_AGREE_ERROR = 3000002;
    public static final Integer ORDER_NOT_EXITS = 3300003;
    public static final Integer ORDER_SKU_ERROR = 3300004;
    public static final Integer ADVICE_TYEE_ERROR = 330005;


    //pay info
    public static final Integer PROJECT_REFUND_NOTENOUGH = 500000;
    public static final Map<Integer, String> error = new HashMap<Integer, String>(){
        {
            put(AUTHORITY_ERROR, "权限不够");
            put(MOBILE_ERROR, "电话号码错误");
            put(NET_WORD_ERROR, "网路错误");
            put(AUTH_CODE_ERROR, "验证码错误");
            put(USER_NOT_EXIST, "用户不存在");
            put(USER_INVIAL, "用户无效");
            put(PASSWORD_ERROR, "密码错误");
            put(PROJECT_TYPE_ERROR, "项目类型错误");
            put(START_MONEY_ERROR, "启动资金用该大于0");
            put(PROJECT_ENDTIME_ERROR, "项目结束时间应该晚于现在");
            put(PROJECT_PEOPLE_NUM_ERROR, "项目人数错误");
            put(TIMESTAMP_FORMAT_ERROR, "时间戳格式化错误");
            put(TIMESTAMP_NOT_IS_NULL, "时间戳不能为空");
            put(SYSTEM_ERROR, "系统错误");
            put(USER_ACTIVITY_GET_ALREADY, "订单已支付");
            put(INVALID_INVITATION_CODE, "邀请码无效");
            put(ORDER_NOT_IS_NULL, "订单不能为空");
            put(PROJECT_INTRODUCE_TYPE_ERROR, "项目介绍类型错误");
            put(UNIT_PRICE_ERROR, "单价错误");
            put(SKU_NUMBER_ERROR, "sku数量错误");
            put(PROJECT_NOT_EXIST, "项目不存在");
            put(AGGREMENT_NOT_IS_NULL, "协议不能为空");
            put(SERVICE_BONUS_IS_ERROR, "服务费或分红错误");
            put(SKU_IS_EMPTY, "项目没有sku");
            put(SKU_INVAIL, "sku无效");
            put(PROJECT_AGREEMENT_EXIST,"项目已经签过协议");
            put(PROJECT_CREATE_ERROR,"你没有创建项目的权限");
            put(INVITEE_NOT_ENOUGH,"邀请d人数不够");
            put(PROJECT_INTRODUCE_TEXT_ERROR, "项目介绍内容为空");
            put(PASSWORD_DONT_SAME, "两次密码不一致");
            put(PHONE_NUMBER_NOT_REGISTRIED, "该号码未注册 ");
            put(PROJECT_INTRODUCE_CTYPE_ERROR, "项目介绍类型错误");
            put(PHONE_NUMBER_CHANGED, "接收验证码d手机号和当前手机号不一致");
            put(PASSWORD_NOT_QUALIFIED, "密码无效");
            put(ORDER_CANT_CONFIRM_RECEIVE, "订单还未付款，无法确认收货");
            put(PROJECT_INTRODUCE_IS_EMPTY,"内容为空");
            put(INTIVATION_IS_EMPTY, "邀请为空");
            put(USERID_CAST_ERROR, "用户id转换错误");
            put(PLEASE_LOGIN, "请登陆");
            put(ENDTIME_ERROR, "结束时间错误");
            put(SMALL_NUMBER_ERROR, "小数字错误 ");
            put(SETT_AGREE_ERROR, "成本不能大于结算 ");
            put(PROJECT_INTRODUCE_ARGUMENT_ERROR, "index或者size错误");
            put(USER_ALREADY_EXISTS,"用户已经存在");
            put(ACTIVITY_NOT_EXIST, "活动不存在");
            put(USER_EXIST, "用户已存在");
            put(USER_NOT_FOLLOW_PROJECT, "还没有关注任何项目");
            put(PROJECT_ALREADY_FOLLOWED, "该项目已关注");
            put(USER_ACTIVITY_EXIST, "活动已参加");
            put(STICK_ID_ERROR, "评论id错误");
            put(INDEX_ERROR, "index错误");
            put(SIZE_ERROR, "size错误");
            put(TAG_ERROR, "tag错误");
            put(ORDER_PAID_ALREADY, "订单已经支付");
            put(Aliase_Type_Error, "第三方登陆类型错误");
            put(ORDER_PAID_FAILED, "支付失败");
            put(SECURITY_CODE_NOT_SAME, "两次安全码不一致");
            put(SECURITY_LENGTH_ERROR, "安全码长度错误，必须在6-20位之间");
            put(DATE_ERROR, "时间错误");
            put(ORDER_SKU_ERROR, "订单sku错误");
            put(NO_FOLLOWED_PROJECTED, "没有关注项目");
            put(PROJECT_REFUND_NOTENOUGH, "项目人数不足，或项目不存在");
            put(LOG_OUT_ERROR, "退出登陆失败");
            put(USER_NOT_BUSINESS, "用户不是商家");
            put(PROJECT_NEDD_RECEIVE_GOOD, "该商品需要用户收货，商家无法确认收货");
            put(AUDIT_STATUS_ERROR, "审核状态错误");
            put(ORDER_INVIAL, "订单无效");
            put(ORDER_RECEIVED_ALREADY, "已经确认收货");
            put(PROJECT_INTRODUCE_CREATE_ERROR, "创建项目介绍错误");
            put(SUPPORT_INFO_IS_NULL, "支持信息为空");
            put(ADDRESS_IS_NULL, "地址为空");
            put(FILE_UPLOAD_FAILED, "文件上传失败");
            put(ORDER_NOT_EXITS, "订单不存在");
            put(NOT_IS_ADMIN, "请用管理员帐号登录");
            put(TRADE_NUMBER_EXIT, "trade_number 不能为空");
            put(ADVICE_TYEE_ERROR, "建议类型错误");
            put(UP_MP_DP_OR_ERROR,"价格不能是负数");
            put(WEIXIN_ALREADY_LINKED, "微信号已经关联");
            put(GET_WEIXIN_TOKEN_ERROR, "获取微信ACCESS_TOKEN出错");
        }
    };

}
